home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / util / idproj.c < prev    next >
Encoding:
Text File  |  1996-08-26  |  462 b   |  25 lines

  1. /* idproj.c */
  2.  
  3.  
  4. /*
  5.  * Setup an identity projection such that glVertex(x,y) maps to
  6.  * window coordinate (x,y).
  7.  */
  8.  
  9.  
  10.  
  11.  
  12.  
  13. void IdentityProjection( GLint x, GLint y, GLsizei width, GLsizei height )
  14. {
  15.    glViewport( x, y, width, height );
  16.    glMatrixMode( GL_PROJECTION );
  17.    glLoadIdentity();
  18.    glOrtho( (GLdouble) x, (GLdouble) y,
  19.             (GLdouble) width, (GLdouble) height,
  20.             -1.0, 1.0 );
  21.    glMatrixMode( GL_MODELVIEW );
  22.    glLoadIdentity();
  23. }
  24.  
  25.